package com.example.test_event_and_callback.infras.event;

import com.example.test_event_and_callback.infras.event.BaseEventDto;
import org.springframework.context.ApplicationEvent;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author Song Dan Yang
 * Description: </br>
 * date: 2023/11/21 15:49
 */
public abstract class CallableEvent<T extends BaseEventDto> extends ApplicationEvent {

//    private final BaseEventDto result = T.getInstance();

//    private CallableEventDtoProxy proxy = new CallableEventDtoProxy(TestEventDto.class);

    protected final AtomicInteger count = new AtomicInteger();

    protected T dto;

    private Thread callBackThread;

    abstract public void setCount();
    abstract public void setDto();
    abstract public void setResult(String key, Object value);

    public T getDto() {
        return dto;
    }

    public CallableEvent(Object source) {
        super(source);
    }

    public Thread getCallBackThread() {
        return callBackThread;
    }

    public void setCallBackThread(Thread callBackThread) {
        this.callBackThread = callBackThread;
    }

}
